package cn.tedu._01mvcboot01.controller;

import cn.tedu._01mvcboot01.pojo.dto.AddCarDTO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CarController {
    @GetMapping("/v1/car/addcar")
    @ResponseBody
    public String addcar(String brand,String color,double price){
        System.out.println("brand = " + brand);
        System.out.println("color = " + color);
        System.out.println("price = " + price);
        return "添加成功";
    }

    @PostMapping("/v1/car/addcar2")
    @ResponseBody
    public String addcar2(AddCarDTO addCarDTO){
        System.out.println("addCarDTO = " + addCarDTO);
        return "添加成功";
    }
}
